<template>
	<button open-type="getUserInfo" class="phone-btn" @getuserinfo="getUserInfo" plain />
</template>


<script>
	import {
		wx_customer_upd
	} from '@/api'
	import store from '@/store'
	export default {
		methods: {
			getUserInfo(obj) {
				const userInfo = obj.detail.userInfo
				wx_customer_upd({
					"image": userInfo.avatarUrl,
					"gender": userInfo.gender,
					"name": userInfo.nickName
				}).then(() => {
					store.dispatch('setIsUserInfo', true)
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.phone-btn {
		width: 100%;
		height: 100%;
		border: none;
	}
</style>